package com.mlan.userap.fragment;

import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import androidx.fragment.app.Fragment;

import com.mlan.userap.dialog.LoadingDialog;

import org.greenrobot.eventbus.EventBus;

public class BaseFragment  extends Fragment {
    private LoadingDialog dialogLoading = null;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            //   mParam1 = getArguments().getString(ARG_PARAM1); 接收参数
        }
        EventBus.getDefault().register(this);
        Log.e("TAG", "BaseFragment: ");
    }
    public void loadingShow() {
        dialogLoading =new LoadingDialog(getActivity());
        dialogLoading.show();
    }
    public  void loadingClose() {
        if(dialogLoading!=null) {
            dialogLoading.dismiss();
            dialogLoading = null;
        }
    }
    public void showToast(String content){
        Toast.makeText(getActivity(), content, Toast.LENGTH_SHORT).show();
    }
}
